<include file="public@header"/>
</head>
<body>
<div class="wrap">
	<ul class="nav nav-tabs">
		<li><a href="{:url('student/index')}">学生列表</a></li>
		<li class="active"><a href="{:url('student/add')}">学生班级</a></li>
	</ul>
	<form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('student/addPost')}">
		<div class="form-group">
			<label for="name" class="col-sm-2 control-label">头像<span class="form-required">*</span></label>
			<input id="photo-1" type="hidden" name="image" >
			<input id="photo-1-name" type="text" name="photo_name" title="图片名称">
			<img id="photo-1-preview" width="50px" height="50px">
			<a href="javascript:uploadOneImage('图片上传','#photo-1');">上传</a>
		</div>
		<div class="form-group">
			<label for="name" class="col-sm-2 control-label">姓名<span class="form-required">*</span></label>
			<div class="col-md-6 col-sm-10">
				<input type="text" class="form-control" id="name" name="name">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">性别<span class="form-required">*</span></label>
			<div class="col-md-6 col-sm-10">
				<input type="radio"  name="sex" value="1" checked >男
				<input type="radio" name="sex" value="2">女
			</div>
		</div>
		<div class="form-group">
			<label for="idcard" class="col-sm-2 control-label">身份证号<span class="form-required">*</span></label>
			<div class="col-md-6 col-sm-10">
				<input type="text" class="form-control" id="idcard" name="idcard">
			</div>
		</div>
		<div class="form-group">
			<label for="address" class="col-sm-2 control-label">家庭住址<span class="form-required">*</span></label>
			<div class="col-md-6 col-sm-10">
				<input type="text" class="form-control" id="address" name="address">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">所属学校<span class="form-required">*</span></label>
			<div class="col-md-6 col-sm-10" >
				<select class="form-control" name="" id="selectSchool" >
					<option value="0">|--请选择学校--|</option>
					<foreach name="school" item="vo">
						<option value="{$vo.id}">{$vo.name}</option>
					</foreach>
					</select>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">所属班级<span class="form-required">*</span></label>
			<div class="col-md-6 col-sm-10" >
				<select name="room_id" id="room" class="form-control">
					<option value="">|--请选择班级--|</option>
					</select>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">是否在籍<span class="form-required">*</span></label>
			<div class="col-md-6 col-sm-10" >
				<select class="form-control" name="status" >
					<option value="">请选择</option>
					<option value="2">是</option>
					<option value="1">否</option>
				</select>
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-offset-2 col-sm-10">
				<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
					<a class="btn btn-default" href="{:url('student/index')}">{:lang('BACK')}</a>
			</div>
		</div>
	</form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script>
    $(function () {
        $('#selectSchool').change('click',function () {
            var schoolId=$('#selectSchool').val();
            $.ajax({
                url:"{:url('student/getRoomBySchool')}",
                type:"POST",
                data:{school_id:schoolId},
                success:function (res) {
                    console.log(res);
                    $('#room').html(res);
                }
            })
        })
    })
</script>
</body>
</html>
